{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Becker's Barley Trellis Plot\n",
    "----------------------------\n",
    "This example shows how to make a Trellis Plot with the barley dataset.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "import altair as alt\n",
    "alt.data_transformers.enable('json')\n",
    "from vega_datasets import data\n",
    "\n",
    "source = data.barley()\n",
    "\n",
    "alt.Chart(source).mark_point().encode(\n",
    "    alt.X('median(yield)', scale=alt.Scale(zero=False)),\n",
    "    alt.Y(\n",
    "        'variety',\n",
    "        sort=alt.SortField(field='yield', op='median', order='descending'),\n",
    "        scale=alt.Scale(rangeStep=20)\n",
    "    ),\n",
    "    color='year:N',\n",
    "    row='site'\n",
    ")\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "env": {},
   "interrupt_mode": "signal",
   "language": "python",
   "metadata": {},
   "name": "python3"
  },
  "language": "python"
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
